//月度任务下达控制
jQuery(document).ready(function(){
checkCustomize = function(){
//预定任务id
var ydrwFieldid=WfForm.convertFieldNameToId("ydrw","detail_1");
//销售任务额id
var xsrweFieldid=WfForm.convertFieldNameToId("xsrwe","detail_1");
//节点控制id
var jdkzField=WfForm.convertFieldNameToId("jdkz");
//获取明细表所有下标值
var submitdtlid0=jQuery("#submitdtlid0").val();
if(submitdtlid0!=null){
var subArr=submitdtlid0.split(",");
for(var index=0;index<subArr.length-1;index++){
debugger;
  //预定任务值
  var ydrwVal=WfForm.getFieldValue(ydrwFieldid+"_"+subArr[index]);
  alert(ydrwVal+";预定任务值");
  //销售任务额值
  var xsrweVal=WfForm.getFieldValue(xsrweFieldid+"_"+subArr[index]);
    alert(xsrweVal+";销售任务值");
  //预定任务浮动10%的区间值为
  var downVal=ydrwVal-ydrwVal*0.1;
  var upVal=ydrwVal*1+ydrwVal*0.1;
  //判断销售任务额是否在此区间内
  if(xsrweVal<=upVal&&xsrweVal>=downVal){
   WfForm.changeFieldValue(jdkzField, {value:"0"});
  }else{
     WfForm.changeFieldValue(jdkzField, {value:"1"});

   return true;
  }
}
}
  return true;
}
})